Query Builder
The IQNOX Query Builder Widget is a powerful and intuitive tool designed to simplify complex query creation within the ThingWorx platform. Built on top of the popular jQuery QueryBuilder library, this widget provides a user-friendly, visual interface for building dynamic and nested queries without writing a single line of code.
Example

Usage
The Query Builder Widget empowers both technical and non-technical users to:
- Build advanced queries for infotables or data services
- Filter large datasets efficiently based on dynamic criteria
- Accelerate development time by eliminating the need for manual query coding
- Enable end-users to customize filters in dashboards or reports directly
Properties
Properties | Type | Binding | Default | Description |
---|---|---|---|---|
CustomClass | STRING | <> | Enables you to define an html class to the top div of the widget. Multiple classes can be entered, separated by space. | |
Data | INFOTABLE | < | An InfoTable containing the list of fields that can be used in the query builder and conditions can be added on | |
Query | QUERY | <> | Represents the current query. As users interact with the Query Builder, the Query is updated to reflect those changes. | |
DisplayField | FIELDNAME | How should the field be shown to the user. If empty, the name will be used. | ||
BaseTypeField | FIELDNAME | What baseType the field has, needed to identify what operators to show. | ||
NameField | FIELDNAME | The name of the field, used inside the the Query property when filters are created. | ||
SectionField | FIELDNAME | Split the fields into sections. | ||
ValuesField | FIELDNAME | The possible values if the field only allows a limited set of values. | ||
AllowGroups | NUMBER | < | 1000 | Number of allowed nested groups. Setting it to 0 will disable nested groups. |
AllowAnd | BOOLEAN | < | true | Allow for AND conditions. |
AllowOr | BOOLEAN | < | true | Allow for OR conditions. |
ContainsValidQuery | BOOLEAN | > | Is the current query valid. | |
IsQueryEmpty | BOOLEAN | > | The current query is empty (no rules). | |
DatePickerFormat | STRING(localized) | < | DD/MM/YYYY HH:mm:ss | Display format for date values selected in a query. Format date using Format Complex. SimpleDateFormat rules are accepted, along with prefixes and suffixes. |
ReadOnly | BOOLEAN | false | If enabled, the query builder will be read-only. |
Services
Property | Type | Binding | Description |
---|---|---|---|
ClearQuery | EVENT | < | Clears the query. |
Events
Property | Type | Binding | Description |
---|---|---|---|
QueryChanged | EVENT | > | Triggered when the query has changed. |
DataShapes
To utilize the query builder, it is required to create a datashape that defines the fields intended to be used and displayed by it.
To constrain the selectable options on a specific field, the corresponding row in the dataset must include an infotable within the column mapped to the ValuesField. This infotable is required to conform to the IQNOX_CommonDisplayValue_DS
datashape, which defines the structure of the permissible values.
IQNOX_CommonDisplayValue_DS
value: STRING // actual value
display: STRING // text to show in the value dropdown
section: STRING // under what section should it be located
Behavior
- If valid
Data
is provided forvalues
, the Dropdown will display these server-provided options. - If no matching entry is found in
Data
for a column, the dropdown will fall back to the default behavior - using input from the user.
Important notes
- Inserting a query programmatically that has more groups than allowed in
AllowGroups
will not register the entire query in the widget.